import { createI18n } from "vue-i18n";
import { getStorage } from "../utils/localStorage";
import zh from "./zh.json";
import en from "./en.json";

// 直接从本地读取 或者 store
const locale = getStorage("lang");
// 创建i18n实例
const i18n = createI18n({
  locale: locale?.lan || "zh",
  legacy: false,
  globalInjection: true,
  messages: {
    en,
    zh,
  },
});

export default i18n;
